#!/usr/bin/env perl

sub find_dependence {
	my $filename = shift;
	my @libs;
	open CONTENT, "otool -L $filename|";
	while (<CONTENT>) {
		push @libs, $1 if /^\t(\/.+.dylib)/;
	}
	close(CONTENT);
	return @libs;
}

my $filename = shift or die("usage: $0 /path/to/binary\n");
my @libs = find_dependence $filename;
foreach my $lib (@libs) {
	print "$lib\t";
	print -f $lib ? "\n" : "(NOT FOUND)\n";
}
